package com.ehualu.check.utils;

import com.ehualu.check.CheckFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @Author: 吴敬超
 * @Date: 2021/3/19 10:45
 */
public class CheckThread implements Runnable {

    private static final Logger LOG = LoggerFactory.getLogger(CheckThread.class);

    private final String id;
    private final String extPath;
//    private final String extHashMothod;

    public CheckThread(String id, String extPath) {
        this.id = id;
        this.extPath = extPath;
//        this.extHashMothod = extHashMothod;
    }


    @Override
    public void run() {
        LOG.info("线程校验文件ID：" + id);

        LOG.info("线程校验文件：" + extPath);

        CheckUtil checkUtil = new CheckUtil();

        try {
//            checkUtil.checkfile(id, extPath, extHashMothod);
            checkUtil.checkfile(id, extPath);


        } catch (IOException e) {
            e.printStackTrace();

            LOG.info("计算校验出错，校验文件的ID：" + id);
            LOG.info("计算校验出错，校验文件：" + extPath);

        }


    }
}
